<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        function maxr(char) {
            var s = char.charAt(0);
            var max = s.length;
            for (var i = 1; i <= char.length-1; i++) {
                if (char.charAt(i) == char.charAt(i-1)) {
                    s = s.concat(char.charAt(i));
                    if (s.length > max) {
                        max = s.length;
                        var str = s;
                    }
                } else {
                    s = char.charAt(i);
                }
            }
            return str;
        }

        console.log(maxr("mmmiijjjjkkkkkkssptr"));
        console.log(maxr("aabbbsdssbbo"));

    </script>
</head>
<body>
    
</body>
</html>